package cisdi.mes.sm.rm.web;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import cisdi.mes.sm.rm.service.MatReturnMgr;

@Controller
public class MatReturnCtl {

	@Autowired
	private MatReturnMgr matReturnMgr;

	@RequestMapping("/rm/MatReturnCtl/matReturn")
	@ResponseBody
	public Map<String, Object> matReturn(HttpServletRequest request,
			@RequestParam("measureId") String measureId,@RequestParam("deliveryType") String deliveryType) {

		Map<String, Object> serverInfo = new HashMap<String, Object>();
		try {
			serverInfo = matReturnMgr.matReturn(measureId, deliveryType, request);
		} catch (Exception e) {
			e.printStackTrace();
			serverInfo.put("success", false);
			serverInfo.put("message", e.toString());
		}
		return serverInfo;
	}

}
